/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rainful.echo;

import java.io.Serializable;

/**
 *
 * @author Administrator
 */
public class Echo implements Serializable {

    protected String subjectName;
    protected int level;
    protected int count;

    public Echo(String subjectName) {
        this.subjectName = subjectName;
        this.level = 0;
        this.count = 0;
    }

    public Echo(Echo origin) {
        this.subjectName = origin.subjectName;
        this.level = origin.level;
        this.count = origin.count;
    }

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public void execute(EchoSpace space) {
    }

    public boolean isFinish() {
        return count > 5;
    }

    public Echo done() {
        return new DoneEcho(this);
    }

    public Echo lackNeed(String needString) {
        return new HostNeedEcho(this, needString);
    }

    public Echo error() {
        return new ErrorEcho(this);
    }

    public void counting(){
        count++;
    }
}
